import wx from 'jweixin-module';

export const initWxSdk = (config) => {
    return new Promise((resolve, reject) => {
        wx.config({
            debug: true, // 调试模式
            appId: config.appId,
            timestamp: config.timestamp,
            nonceStr: config.nonceStr,
            signature: config.signature,
            jsApiList: ['chooseImage', 'updateAppMessageShareData'] // 按需填写接口名
        });
        wx.ready(() => resolve(wx));
        wx.error(err => reject(err));
    });
};
